home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F25083_InsTool.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-10  |  1.9 KB  |  77 lines

  1. // InsTool.cpp : Implementation of DLL Exports.
  2.  
  3.  
  4. // Note: Proxy/Stub Information
  5. //        To build a separate proxy/stub DLL, 
  6. //        run nmake -f InsToolps.mk in the project directory.
  7.  
  8. #include "stdafx.h"
  9. #include "resource.h"
  10. #include "initguid.h"
  11. #include "InsTool.h"
  12.  
  13. #include "InsTool_i.c"
  14. #include "InsSymb.h"
  15.  
  16. COleVariant varMissing((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
  17. COleVariant varTrue(1L);
  18. COleVariant varFalse(0L);
  19.  
  20. CComModule _Module;
  21.  
  22. BEGIN_OBJECT_MAP(ObjectMap)
  23.     OBJECT_ENTRY(CLSID_InsSymb, CInsSymb)
  24. END_OBJECT_MAP()
  25.  
  26.  
  27. CInsToolApp theApp;
  28.  
  29. BOOL CInsToolApp::InitInstance()
  30. {
  31.     _Module.Init(ObjectMap, m_hInstance);
  32.     return CWinApp::InitInstance();
  33. }
  34.  
  35. int CInsToolApp::ExitInstance()
  36. {
  37.     _Module.Term();
  38.     return CWinApp::ExitInstance();
  39. }
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // Used to determine whether the DLL can be unloaded by OLE
  43.  
  44. STDAPI DllCanUnloadNow(void)
  45. {
  46.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  47.     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  48. }
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // Returns a class factory to create an object of the requested type
  52.  
  53. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  54. {
  55.     return _Module.GetClassObject(rclsid, riid, ppv);
  56. }
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59. // DllRegisterServer - Adds entries to the system registry
  60.  
  61. STDAPI DllRegisterServer(void)
  62. {
  63.     // registers object, typelib and all interfaces in typelib
  64.     return _Module.RegisterServer(TRUE);
  65. }
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. // DllUnregisterServer - Removes entries from the system registry
  69.  
  70. STDAPI DllUnregisterServer(void)
  71. {
  72.     _Module.UnregisterServer();
  73.     return S_OK;
  74. }
  75.  
  76.  
  77.